<?php //debug($organisation);    ?>
<div class="panel-group m-b" id="accordion2">
    <div class="panel">
        <div class="panel-heading">
            <a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
                <i class='fa fa-info-circle'></i> Basic Information
            </a>
        </div>
        <div id="collapseOne" class="panel-collapse in" style="height: auto;">
            <div class="panel-body text-sm">

                <div class="col-lg-7 b-r">
                    <h5><b>Details</b></h5>

                    <div class="row">
                        <div class="col-lg-3">
                            <a href="#" class="pull-left thumb m-r">
                                <?php if ($organisation['Organisation']['logo']) { ?>
                                    <img src="<?php echo $this->Html->url($organisation['Organisation']['logo']); ?>" class="img-thumbnail">
                                <?php } else { ?>
                                    <img src="<?php echo $this->Html->url('/img/logo_placeholder.jpg'); ?>" class="img-thumbnail">
                                <?php } ?>
                            </a>
                        </div>

                        <div class="col-lg-9">
                            <p><b><?php echo $organisation['Organisation']['name']; ?></b></p>
                            <p><i class="fa fa-home"></i> <?php echo $organisation['Organisation']['address']; ?></p>
                            <p class="p-l">
                                <?php echo $organisation['Organisation']['city']; ?>
                                <?php echo $organisation['Organisation']['state']; ?>
                                <?php echo $organisation['Organisation']['post_code']; ?>
                            </p>
                            <p class="p-l"><?php echo $organisation['Organisation']['country']; ?></p>

                            <p class="m-t-sm"><i class="fa fa-envelope"></i> <?php echo $organisation['Organisation']['email']; ?></p>
                            <p class="m-t-sm"><i class="fa fa-phone"></i> <?php echo $organisation['Organisation']['phone']; ?></p>

                            <p>
                                <a href="#" class="btn"></a>
                            </p>
                        </div>
                    </div>

                    <h5><b>Subscription</b></h5>
                    <div class="row m-b-sm">
                        <div class="col-lg-3">Type:</div>
                        <div class="col-lg-8"><?php echo strtoupper($organisation['OrganisationSubscription'][0]['SubscriptionType']['name']); ?></div>
                    </div>

                    <div class="row m-b-sm">
                        <div class="col-lg-3">Registered:</div>
                        <div class="col-lg-8"><?php echo date('d M, y - h:ia', strtotime($organisation['OrganisationSubscription'][0]['start_dt'])); ?></div>
                    </div>

                    <div class="row m-b-sm">
                        <div class="col-lg-3">Expires:</div>
                        <div class="col-lg-8"><?php echo date('d M, y - h:ia', strtotime($organisation['OrganisationSubscription'][0]['end_dt'])); ?></div>
                    </div>
                </div>

                <div class="col-lg-5">
                    <h5><b>Statistics</b></h5>

                    <ul class="list-group no-radius text-sm">
                        <?php foreach ($stats as $stat) { ?>
                            <li class="list-group-item">
                                <i class="fa fa-group"></i>
                                <span class=""><?php echo $stat['category_name']; ?></span>
                                <span class="pull-right font-bold"><?php echo $stat['members']; ?></span>
                            </li>
                        <?php } ?>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <!--<div class="panel">
        <div class="panel-heading">
            <a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
                <i class='fa fa-tags'></i> Subscription
            </a>
        </div>
        <div id="collapseTwo" class="panel-collapse collapse" style="height: 0px;">
            <div class="panel-body text-sm">
                
            </div>
        </div>
    </div>-->
    <div class="panel">
        <div class="panel-heading">
            <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseThree">
                <i class="fa fa-cog"></i> Data
            </a>
        </div>
        <div id="collapseThree" class="panel-collapse collapse" style="height: auto;">
            <div class="panel-body text-sm">
                <form action="<?php echo $this->Html->url(array('action' => 'data')); ?>" method="post">
                    <div class="col-lg-7">
                        Export All Data For This Organisation To File
                    </div>

                    <div class="col-lg-5">
                        <button id="export_btn" class="btn btn-sm btn-info" type="submit">
                            <i class="fa fa-cloud-download"></i> Export Data
                        </button>
                        
                        <input type="hidden" name="organisation_id" value="<?php echo $organisation['Organisation']['id']; ?>" />
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>